package july2;

public class Test06 {
    public static void main(String[] args) {
        System.out.println(sum(20));
    }

    public static int sum(int a) {
        if (a == 1) {
            return 1;
        } else if (a == 2) {
            return 2;
        } else if (a == 3) {
            return 3;
        }

        return sum(a - 1) + sum(a - 2) + sum(a - 3);
    }
}
